package com.hww.kafka.comsumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @Author: Wenwu Huang
 * @Date: 2020/1/4 9:51
 */
@Component
@Slf4j
public class KafkaReceiver {


    @KafkaListener(topics = {"hellow"})
    public void receive(ConsumerRecord<?, ?> record) {
        Object value = record.value();

        log.info("----------------- record =" + record);
        log.info("------------------ message =" + value);
    }
}
